@import '~components/common/teambition/bem.scss';
@import '~components/common/newbie-common.scss';

$prefix: codeup-newbie-task;

@include block($prefix) {
  height: 120px;
  position: fixed;
  bottom: 0;
  right: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
  background-image: linear-gradient(180deg, #f1fbfe 0%, #fff 100%);
  box-shadow: 0 -2px 24px 0 rgba(38, 38, 38, 0.1), inset 0 1px 0 0 #e5e5e5;
  border-top: 4px solid #1f9aef;
  transition: transform 0.15s cubic-bezier(0.36, 0.49, 0.64, 1.31);
  transform: translateY(0);
  padding-top: 0 !important;
  display: flex;
  align-items: center;
  z-index: 50;
  &__content {
    padding: 0 40px;
    flex: 1;
  }
  &.closeExpand {
    transform: translateY(calc(100% - 4px));
  }
  @include element(arrows) {
    position: absolute;
    top: -22px;
    right: calc(50% - 18px);
    min-width: 36px;
    min-height: 18px;
    text-align: center;
    line-height: 18px;
    background: #1f9aef;
    border-radius: 4px 4px 0 0;
    color: white;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    .next-icon {
      color: white;
    }
    &.arrowsOpen {
      padding: 6px 8px 6px 2px;
      top: -32px;
    }
  }
  @include element(arrows-close) {
    position: absolute;
    right: calc(50% - 49px);
    min-height: 18px;
    text-align: center;
    line-height: 18px;
    background: #e5e5e5;
    color: white;
    font-size: 14px;
    border-radius: 0 4px 0 0;
    width: 38px;
    height: 28px;
    cursor: pointer;
    z-index: 99;
    display: none;
    .next-icon {
      color: white;
    }
    padding: 6px 8px 6px 12px;
    top: -32px;
    &.show {
      display: block;
      right: calc(50% - 49px);
    }
    &.finished {
      display: block;
      right: calc(50% - 49px);
    }
  }
  @include element(header) {
    font-size: 16px;
    color: #262626;
    margin-right: 20px;
    width: 300px;
    @include modifier_1(title) {
      font-weight: 500;
      font-size: 20px;
      color: #262626;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    @include modifier_1(desc) {
      font-size: 14px;
      margin-top: 4px;
      color: #8c8c8c;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
  @include element(content) {
    height: 100%;
    display: flex;
    align-items: center;
    overflow-y: auto;
    @include element(card) {
      margin-right: 17px;
      border-radius: 6px;
      width: 252px;
      font-size: 14px;
      // flex: 1;
      height: 64px;
      box-shadow: $card-shadow-normal;
      transition: $card-transition;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 14px;
      cursor: pointer;
      &:hover {
        box-shadow: $card-shadow-hover;
        transform: $card-translateY;
      }
      &:last-child {
        margin-right: 0;
      }
      &.desc {
        background-image: linear-gradient(174deg, #72c9ff 0%, #ccecfe 100%);
      }
      @include modifier_1(text) {
        font-weight: 500;
        color: white;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      @include modifier_1(btn) {
        background: #1b9aee;
        border-radius: 16px !important;
        width: 80px;
        height: 32px !important;
        line-height: 0 !important;
        border-width: 0;
        border-style: none;
        &.complete {
          color: white;
          background-color: transparent;
          &:hover {
            background-color: transparent;
            color: white;
          }
        }
        &.abandon {
          margin-left: auto;
          color: #ad4e01;
        }
        &.welfare {
          color: #d46b08;
          background: white;
          border-width: 0;
          position: relative;
          padding: 0 6px;
          &:hover {
            color: #d46b08;
            background-color: white;
            border-color: white;
            text-decoration: none;
          }
        }
      }
      @include modifier_1(desc_text) {
        text-align: left;
        line-height: 20px;
        font-weight: 500;
        font-size: 12px;
        color: #fff;
        width: 242px;
        height: 40px;
      }
      @include element(add_repo) {
        background: #1b9aee;
        border-radius: 16px;
        width: 120px;
        height: 32px;
        display: flex;
        box-shadow: $card-shadow-normal;
        transition: $card-transition;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        button {
          background: transparent !important;
        }
        &:last-child {
          margin-right: 0;
        }
        @include modifier_1(create) {
          min-width: 59px !important;
          padding: 0 !important;
          border-radius: 0 16px 16px 0 !important;
          font-weight: normal !important;
          font-size: 14px !important;
          color: #fff !important;
          line-height: 32px !important;
          width: 59px !important;
          height: 32px !important;
          text-align: center;
          border: 0 !important;
          &:hover {
            background-color: #0171c2 !important;
          }
          .next-btn-space {
            width: 0 !important;
          }
        }
        @include modifier_1(import) {
          min-width: 59px !important;
          padding: 0 !important;
          border-radius: 16px 0 0 16px !important;
          font-weight: normal !important;
          font-size: 14px !important;
          color: #fff !important;
          line-height: 32px !important;
          width: 59px !important;
          height: 32px !important;
          text-align: center;
          border: 0 !important;
          &:hover {
            background-color: #0171c2 !important;
          }
          .next-btn-space {
            width: 0 !important;
          }
        }
        @include modifier_1(divide) {
          opacity: 0.3;
          width: 1px;
          height: 20px;
          margin: 6px 0;
          border: 1px solid #fff !important;
        }
      }
    }
  }
}

.codeup-newbie-task__content__card {
  min-width: 252px;
}

.codeup-newbie-task-welfare-dialog {
  z-index: 99999 !important;
  width: unset !important;
  .#{$teamix-prefix}dialog-body {
    padding: 0;
  }

  &-container {
    display: flex;
    width: 640px;
    &-img {
      width: 360px;
      background-image: url(https://img.alicdn.com/tfs/TB1j7zGJq61gK0jSZFlXXXDKFXa-740-840.png);
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }

    &-detail {
      margin: 20px 30px 0 28px;

      &-title {
        text-align: left;
        font-family: PingFangSC-Medium;
        font-size: 28px;
        color: #fff;
        margin-bottom: 48px;
      }

      &-detail {
        margin-top: 15px;
        text-align: left;
        line-height: 20px;
        font-family: PingFangSC-Medium;
        font-size: 14px;
        color: #fff;
        display: flex;
        align-items: center;
        cursor: pointer;
      }

      &-desc {
        margin-top: 15px;
        line-height: 28px;
        &-item {
          display: flex;
          align-items: center;
          margin-bottom: 18px;

          &-icon {
            color: #fff;
            opacity: 0.6;
          }

          &-text {
            margin-left: 4px;
            text-align: left;
            font-family: PingFangSC-Medium;
            font-size: 14px;
            color: #fff;
          }
        }
      }
    }

    &-content {
      width: 270px;

      &-title {
        padding: 30px 0 0 40px;
        text-align: left;
        font-family: PingFangSC-Medium;
        font-size: 20px;
        color: #262626;
      }

      &-desc {
        padding: 4px 0 0 40px;
        text-align: left;
        font-family: PingFangSC-Regular;
        font-size: 14px;
        color: #8c8c8c;
      }

      &-task {
        margin: 32px 0 0 40px;
        display: flex;
        &-left {
          padding-top: 6px;
          &-circle {
            &-unfinish {
              width: 10px;
              height: 10px;
              border-radius: 50%;
              border: 2px solid #d9d9d9;
            }
            &-complete {
              width: 10px;
              height: 10px;
              border-radius: 50%;
              border: 2px solid #1b9aee;
            }
          }
          &-line {
            border: 2px solid #f0f0f0;
            width: 1px;
            height: 51px;
            margin: 6px 0 6px 3px;
          }
        }
        &-item {
          display: flex;
          align-items: center;
          margin: 0 0 48px 12px;
          height: 24px;

          &-title {
            text-align: left;
            font-family: PingFangSC-Medium;
            font-size: 14px;
            color: #262626;
            letter-spacing: -0.08px;
          }

          &-btn {
            &-todo {
              background: #1b9aee;
              width: 64px;
              height: 24px;
              border-radius: 16px;
              cursor: pointer;
              text-align: center;
              line-height: 22px;
              margin-left: 6px;

              .btn-text {
                font-family: PingFangSC-Regular;
                font-size: 12px;
                color: #fff;
                letter-spacing: -0.07px;
                text-align: left;
              }
            }

            &-finished {
              background: #e5e5e5;
              border-radius: 16px;
              width: 64px;
              height: 24px;
              text-align: center;
              line-height: 22px;
              margin-left: 6px;

              .btn-text {
                font-family: PingFangSC-Regular;
                font-size: 12px;
                color: #8c8c8c;
                letter-spacing: -0.07px;
                text-align: left;
              }
            }
          }
        }
      }
    }
  }

  &-img {
    width: inherit;
    height: inherit;
  }
}

.close-task-enter {
  transition: all 0.3s ease-out;
}
.close-task-exit {
  transition: all 0.3s ease-out;
}

.close-task-finished-enter {
  transition: all 0.3s ease-out;
}
.close-task-finished-enter-active {
  left: 208px;
}
.close-task-finished-exit {
  transition: all 0.3s ease-out;
}
.close-task-finished-exit-active {
  left: 168px;
}
